// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIMIMEService.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// The MIME service is responsible for mapping file extensions to MIME-types
    /// (see RFC 2045). It also provides access to nsIMIMEInfo interfaces and
    /// acts as a general convenience wrapper of nsIMIMEInfo interfaces.
    ///
    /// The MIME service maintains a database with a <b>one</b> MIME type <b>to many</b>
    /// file extensions rule. Adding the same file extension to multiple MIME types
    /// is illegal and behavior is undefined.
    ///
    /// @see nsIMIMEInfo
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("5b3675a1-02db-4f8f-a560-b34736635f47")]
	public interface nsIMIMEService
	{
		
		/// <summary>
        /// Retrieves an nsIMIMEInfo using both the extension
        /// and the type of a file. The type is given preference
        /// during the lookup. One of aMIMEType and aFileExt
        /// can be an empty string. At least one of aMIMEType and aFileExt
        /// must be nonempty.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIMIMEInfo GetFromTypeAndExtension([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aMIMEType, [MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase aFileExt);
		
		/// <summary>
        /// Retrieves a ACString representation of the MIME type
        /// associated with this file extension.
        ///
        /// @param  A file extension (excluding the dot ('.')).
        /// @return The MIME type, if any.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeFromExtension([MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase aFileExt, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase retval);
		
		/// <summary>
        /// Retrieves a ACString representation of the MIME type
        /// associated with this URI. The association is purely
        /// file extension to MIME type based. No attempt to determine
        /// the type via server headers or byte scanning is made.
        ///
        /// @param  The URI the user wants MIME info on.
        /// @return The MIME type, if any.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeFromURI([MarshalAs(UnmanagedType.Interface)] nsIURI aURI, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase retval);
		
		/// <summary>
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeFromFile([MarshalAs(UnmanagedType.Interface)] nsIFile aFile, [MarshalAs(UnmanagedType.LPStruct)] nsACStringBase retval);
		
		/// <summary>
        /// Given a Type/Extension combination, returns the default extension
        /// for this type. This may be identical to the passed-in extension.
        ///
        /// @param aMIMEType The Type to get information on. Must not be empty.
        /// @param aFileExt  File Extension. Can be empty.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetPrimaryExtension([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aMIMEType, [MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase aFileExt, [MarshalAs(UnmanagedType.LPStruct)] nsAUTF8StringBase retval);
	}
}
